package com.ls.pattern.behavior.mediator;

public class CoffeeMachine extends Colleague {
    public CoffeeMachine(Mediator mediator, String name) {
        super(mediator, name);
        mediator.register(name, this);
    }

    public void sendCoffeeMachine(int stateChange) {
        sendMessage(stateChange);
    }


    @Override
    public void sendMessage(int stateChange) {
        this.getMediator().getMessage(stateChange, this.name);
    }

    public void use(){
        System.out.println("使用咖啡机");
    }

    public void unUse(){
        System.out.println("使用咖啡机关机");
    }
}
